import { Controller, Get, Post, Headers, Body } from '@nestjs/common';
import { OssService } from './oss.service';

@Controller('oss')
export class OssController {
  constructor(private readonly ossService: OssService) {}

  @Get('signature')
  async getOssSignature() {
    return this.ossService.getSignature();
  }

  @Post('result')
  getResult(@Headers('x-oss-pub-key-url') xOssPubKeyUrl: string, @Body() file: any) {
    return this.ossService.getResult(xOssPubKeyUrl, file);
  }
}
